<!--
 * @Author: your name
 * @Date: 2021-12-15 17:10:57
 * @LastEditTime: 2021-12-16 15:09:30
 * @LastEditors: your name
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: \geek-admin-test\src\pages\count.vue
-->
<template>
    <div>{{ count }} *2 = {{ double }}</div>
    <button @click="add">add</button>
    <button @click="asyncAdd">async add</button>
</template>

<script setup>
import { computed } from 'vue'
// import {useStore} from 'vuex'
import { useStore } from '../store/gvuex'
let store = useStore()
let count = computed(() => store.state.count)
let double = computed(() => store.getters.double)

function asyncAdd() {
    store.dispatch('asyncAdd')
}
function add() {
    // count.value+=1
    store.commit('add')
}
</script>